home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / nShell Prog / Programmer's Guide / 11 Callbacks - Shell Variables < prev    next >
Encoding:
Text File  |  1994-09-04  |  1.2 KB  |  61 lines  |  [TEXT/ttxt]

  1. 11 Callbacks - Shell Variables
  2. ==============================
  3.  
  4. These routines allow programmers to access nShell variables from within external commands.
  5.  
  6. NSH_var_env
  7. -----------
  8.  
  9. int  NSH_var_env(Str32 name, Str255 value);
  10.  
  11. PARAMETERS
  12.  
  13.     Str32    name    address of a name to be searched
  14.     Str255    value    address to receive the variable's value
  15.  
  16. RETURNS
  17.  
  18.     0    found
  19.     others    not found
  20.  
  21. PROCESS
  22.  
  23. This routine searches the shell environment for the named variable.  If it is located, the value of that variable is copied to the passed string.
  24.  
  25. NSH_var_set
  26. -----------
  27.  
  28. int  NSH_var_set(Str32 name, Str255 value);
  29.  
  30. PARAMETERS
  31.  
  32.     Str32    name    address of a name to be searched
  33.     Str255    value    address to receive the variable's value
  34.  
  35. RETURNS
  36.  
  37.     0    success
  38.     others    error
  39.  
  40. PROCESS
  41.  
  42. This routine searches the shell environment for the named variable.  If that variable is not located, a new variable is created.  The value of the passed string is copied to the shell variable.
  43.  
  44. NSH_var_unset
  45. -------------
  46.  
  47. void NSH_var_unset(Str32 name);
  48.  
  49. PARAMETERS
  50.  
  51.     Str32    name    address of a variable name
  52.  
  53. RETURNS
  54.  
  55.     0    found and deleted
  56.     1    not found
  57.  
  58. PROCESS
  59.  
  60. This routine searches the shell environment for the named variable.  If it is located, that variable is deleted.
  61.